package com.qf.feign;

import com.qf.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf.feign
 * @Description:
 * @Date 2022/7/6 20:04
 */
@FeignClient(value = "QF-SEARCH",fallback = SearchFeignFallback.class)
@RestController
public interface SearchFegin {

    @RequestMapping("/search")
    public String test1();

    /**
     * 模拟根据id查询
     * @param id
     */
     @GetMapping("/search/{id}")
     public Object findById(@PathVariable(value = "id") Integer id);
    /**
     * 模拟根据id和名字查询
     * @param id
     * @param name
     */
    @GetMapping("/findCustomer")
     public Object findByIdAndName(@RequestParam(value = "id") Integer id, @RequestParam(value = "name") String name);

    @PostMapping("/save")
    public User save(@RequestBody User user);





}
